<% if @stages.empty? %>
  No deployments for this host.
<% else %>
  <table class="sortable">
    <tr>
      <th>Project</th>
      <th>Stage</th>
      <th>Role</th>
    </tr>
    <% for stage in @stages %>
      <tr class="<%= cycle :even, :odd, :name => 'stages' %>">
        <td valign="top"><%= link_to h(stage.project.name), project_path(stage.project) %></td>
        <td valign="top"><%= link_to h(stage.name), project_stage_path(stage.project, stage) %></td>
        <td valign="top">
          <% for role in stage.roles.find(:all, :conditions => ['host_id = ?', @host.id]) %>
            <%=h role.name %>
            <%=h role.role_attribute_hash.inspect unless role.role_attribute_hash.blank?  %>
            <br />
          <% end %>
        </td>
      </tr>
    <% end %>
  </table>
<% end %>